home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / gdmthemetester < prev    next >
Encoding:
Text File  |  2007-04-10  |  1.9 KB  |  110 lines

  1. #!/bin/sh
  2.  
  3. gdmwhich () {
  4.   COMMAND="$1"
  5.   OUTPUT=
  6.   IFS=:
  7.   for dir in $PATH
  8.   do
  9.     if test -x "$dir/$COMMAND" ; then
  10.       if test "x$OUTPUT" = "x" ; then
  11.         OUTPUT="$dir/$COMMAND"
  12.       fi
  13.     fi
  14.   done
  15.   IFS=$OLD_IFS
  16.   echo "$OUTPUT"
  17. }
  18.  
  19. echo
  20. echo "GDM Theme Tester"
  21. echo
  22. echo "Be sure to test all the environments:"
  23. echo " console, console-timed, flexi, remote-flexi, xdmcp"
  24. echo "Also be sure to test using caps lock"
  25. echo
  26.  
  27. XNEST=`gdmwhich Xnest`
  28. GDMXNEST=`gdmwhich gdmXnest`
  29. GDMGREETER="/usr/lib/gdm/gdmgreeter"
  30.  
  31. if [ x$XNEST = x ]; then
  32.     echo "ERROR: Xnest not found"
  33.         echo ""
  34.     exit 1
  35. fi
  36.  
  37. if [ x$GDMXNEST = x ]; then
  38.     echo "ERROR: gdmXnest not found"
  39.         echo ""
  40.     exit 1
  41. fi
  42.  
  43. if [ x$GDMGREETER = x ]; then
  44.     echo "ERROR: gdmgreeter not found"
  45.         echo ""
  46.     exit 1
  47. fi
  48.  
  49. USAGE="
  50. Usage: $0 <environment> <theme>
  51. <environment> is one of: console, console-timed, flexi, remote-flexi, xdmcp
  52. <theme> is either the path of the theme or the name of an installed theme
  53.  
  54. If you set the environment variable XNESTSIZE to <width>x<height> (e.g. 800x600)
  55. you can test the greeter at that resolution
  56. "
  57. if [ "$#" != 2 ]; then
  58.     echo "$USAGE"
  59.     exit 1
  60. fi
  61.  
  62. GDM_THEME="$2"
  63. DOING_GDM_DEVELOPMENT=yes
  64. GDM_PARENT_DISPLAY="$DISPLAY"
  65. export GDM_THEME DOING_GDM_DEVELOPMENT GDM_PARENT_DISPLAY
  66.  
  67. case $1 in
  68. console)
  69.     GDM_IS_LOCAL=yes
  70.     export GDM_IS_LOCAL
  71.     ;;
  72. console-timed)
  73.     GDM_IS_LOCAL=yes
  74.     GDM_FAKE_TIMED=yes
  75.     export GDM_IS_LOCAL GDM_FAKE_TIMED
  76.     ;;
  77. flexi)
  78.     GDM_IS_LOCAL=yes
  79.     GDM_FLEXI_SERVER=yes
  80.     export GDM_IS_LOCAL GDM_FLEXI_SERVER
  81.     ;;
  82. remote-flexi)
  83.     GDM_FLEXI_SERVER=yes
  84.     export GDM_FLEXI_SERVER
  85.     ;;
  86. xdmcp)
  87.     ;;
  88. *)
  89.     echo "$USAGE"
  90.     exit 1
  91.     ;;
  92. esac
  93.  
  94. if [ "x$XNESTSIZE" = x ] ; then
  95.   eval `gdmXnest -b`
  96. else
  97.   eval `gdmXnest -b -o "-geometry $XNESTSIZE"`
  98. fi
  99. export DISPLAY
  100.  
  101. if [ "x$GDM_PARENT_DISPLAY" = "x$DISPLAY" ]; then
  102.     echo "ERROR: Can't start the Xnest server"
  103.     exit 1
  104. fi
  105.  
  106. # This may not be necessary
  107. sleep 1
  108.  
  109. /usr/lib/gdm/gdmgreeter
  110.